package com.wave12.utility;

import java.util.Date;

public class CartIdMaker {
    private volatile static CartIdMaker singleton;
    private CartIdMaker(){
        //System.out.println("单件对象初始化");
    }

    public static CartIdMaker getInstance(){
        if(singleton == null){
            synchronized (CartIdMaker.class){
                if(singleton == null){
                    singleton = new CartIdMaker();
                }
            }
        }
        return singleton;
    }

    public long makeOneCartId(){
        Date dtNow = new Date();
        long lNow = dtNow.getTime();
        return lNow;
    }

}
